<template>
	<page-body>
		<view class="page">
			<view class="flex align-stretch benben-position-layout flex cp_flex_0_hjee"
				:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
				<view class='flex align-center justify-center flex-sub cp_fd0_0_hjee'>
					<text class='cp_fd0_0_c2_hjee'>{{$t('中犇教育科技')}}</text>
				</view>

			</view>
			<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
			<!---flex布局flex布局开始-->
			<view class="flex flex-wrap align-stretch benben-flex-layout cp_flex_1_hjee">
				<view class='flex flex-direction align-stretch cp_fd1_0_hjee'>
					<view class='flex flex-wrap align-center cp_fd1_0_c0_hjee' @tap.stop="check('-1')">
						<text class='self-center cp_fd1_0_c0_c0_hjee'>{{$t('查看全部')}}</text>
					</view>
					<template v-for='(item,key0) in nav'>
						<view class='flex flex-wrap align-center cp_fd1_0_c1_hjee' :class="active==key0?'active':''" :key='key0' @tap.stop="check(key0)">
							<text class='cp_fd1_0_c1_c0_hjee' >{{item.cate_name}}</text>
						</view>
					</template>

				</view>
				<view class='flex flex-direction align-stretch flex-sub cp_fd1_1_hjee'>
					
					<scroll-view  scroll-y="true" style="height: 80vh;" class='' >
						<view class="flex flex-wrap align-center cp_fd1_1_c0_hjee"  v-for="(ite,k) in list" :key='k' @tap.stop="handleJumpDiy" data-type="navigateTo"
						:data-url="`/pageindex/detail/detail?id=${ite.aid}`">
							<image class='cp_fd1_1_c0_c0_hjee' mode="aspectFill" :src='ite.fmt'></image>
							<view class='flex flex-direction align-stretch flex-sub cp_fd1_1_c0_c1_hjee'>
								<text class='cp_fd1_1_c0_c1_c0_hjee'>{{ite.cate_name}}</text>
								<text class='cp_fd1_1_c0_c1_c1_hjee'>{{ite.brief}}</text>
							</view>
						</view>
						
					</scroll-view>
				</view>
			</view>

			<!---flex布局flex布局结束-->
			<view class="flex benben-position-layout flex flex-wrap align-center cp_flex_2_hjee">
				<image class='cp_fd2_0_hjee' mode="aspectFit" :src='STATIC_URL+"42.png"' @tap.stop="handleJumpDiy" data-type="navigateTo"
						:data-url="`/pages/tabBar/AI/AI`"></image>

			</view>
			<view :style="{height: '135rpx'}"></view>


		</view>
	</page-body>
</template>
<script>
	import {
		validate
	} from '@/common/utils/validate.js'

	export default {
		components: {},


		data() {
			return {
				/** nav【分类】 **/
				"nav": [],
				list:[],
				all:[],//所有数据
				linkageString: "",
				active:'-1'
			};
		},
		computed: {

		},
		watch: {},
		onLoad(options) {
			this.getnq763be29aeab5Func()
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {

		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {

		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			//查询产品分类
			async getnq763be29aeab5Func() {
				//请求方法
				//数据验证

				let datanav = await this.$api.get(global.apiUrls.post6763be29aeab5, {

				});

				if (datanav.data.code != 1) {
					this.$message.info(datanav.data.msg);
					return
				}
				let infonav = datanav.data;
				this.nav = infonav.data
				this.nav.map(item=>{
					item.children.map(items=>{
						this.all.push(items)
					})
					
				})
				console.log(this.all)
				this.list=this.all
			},
			check(index){
				this.active=index
				if(index!='-1'){
					this.list=this.nav[index].children
				}else{
					this.list=this.all
				}
				
			}
		}
	};
</script>
<style lang="scss" scoped>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: url(image-path('29.png')) no-repeat;
		background-size: 100% 100%;

		.cp_flex_2_hjee {
			width: 135rpx;
			height: 135rpx;
			overflow: hidden;
			z-index: 12;
			right: 0rpx;
			bottom: calc(13% + var(--window-bottom));

			.cp_fd2_0_hjee {
				width: 135rpx;
				height: 135rpx;
				border-radius: 0rpx;
			}
		}

		.cp_flex_1_hjee {
			height: 100%;

			.cp_fd1_0_hjee {
				width: 200rpx;
				background: rgba(244, 248, 253, 1);
				background-size: 100% auto;
				height: 90vh;
				overflow-y: auto;

				.cp_fd1_0_c0_hjee {
					height: 138rpx;
					padding: 0rpx 24rpx 0rpx 24rpx;
					background: var(--benbenbgColor1);
					background-size: 100% auto;

					.cp_fd1_0_c0_c0_hjee {
						-webkit-line-clamp: 2;
						overflow: hidden;
						text-overflow: ellipsis;
						display: -webkit-box;
						-webkit-box-orient: vertical;
						width: 152rpx;
						background: var(--benbenbtnColor0);
						background-size: 100% auto;
						color: var(--benbenFontColor3);
						border-radius: 26rpx;
						height: 52rpx;
						line-height: 52rpx;
						text-align: center;
					}
				}

				.cp_fd1_0_c1_hjee {
					height: 138rpx;
					padding: 0rpx 40rpx 0rpx 40rpx;

					.cp_fd1_0_c1_c0_hjee {
						-webkit-line-clamp: 2;
						overflow: hidden;
						text-overflow: ellipsis;
						display: -webkit-box;
						-webkit-box-orient: vertical;
						color: #666666;
					}
					
				}
				.active{
					background-color: #FFFFFF;
					color: #333333;
				}
			}

			.cp_fd1_1_hjee {
				background: rgba(255, 255, 255, 1);
				background-size: 100% auto;
				padding: 24rpx 0rpx 0rpx 0rpx;
			}
		}

		.cp_fd1_1_c0_hjee {
			padding: 0rpx 24rpx 0rpx 24rpx;
			margin: 0rpx 0rpx 44rpx 0rpx;
		}

		.cp_fd1_1_c0_c0_hjee {
			width: 138rpx;
			height: 138rpx;
			border-radius: 8rpx;
		}

		.cp_fd1_1_c0_c1_hjee {
			margin: 0rpx 0rpx 0rpx 20rpx;
		}

		.cp_fd1_1_c0_c1_c0_hjee {
			color: rgba(51, 51, 51, 1);
			font-weight: 500;
		}

		.cp_fd1_1_c0_c1_c1_hjee {
			-webkit-line-clamp: 2;
			overflow: hidden;
			text-overflow: ellipsis;
			display: -webkit-box;
			-webkit-box-orient: vertical;
			font-size: 24rpx;
			color: rgba(102, 102, 102, 1);
		}

		.cp_flex_0_hjee {
			width: 750rpx;
			height: 88rpx;
			overflow: hidden;
			z-index: 10;
			top: 0rpx;
			background: url(image-path('29.png')) no-repeat;
			background-size: 100% auto !important;

			.cp_fd0_0_hjee {
				padding: 0rpx 32rpx 0rpx 32rpx;
				line-height: 88rpx;
				color: #333;
				background: url(image-path('29.png')) no-repeat;
				background-size: 100% auto;

				.cp_fd0_0_c0_c0_hjee {
					color: #FFFFFF;
					font-size: 36rpx;
					font-weight: 700;
				}

				.cp_fd0_0_c0_c1_hjee {
					width: 28rpx;
					height: 28rpx;
					border-radius: 0rpx 0rpx 0rpx 0rpx;
					margin: 0rpx 0rpx 0rpx 10rpx;
				}

				.cp_fd0_0_c1_c0_hjee {
					width: 50rpx;
					height: 50rpx;
					margin: 0rpx 0rpx 0rpx 32rpx;

					.cp_fd0_0_c1_c0_c0_hjee {
						width: 36rpx;
						height: 36rpx;
						border-radius: 0rpx 0rpx 0rpx 0rpx;
					}
				}

				.cp_fd0_0_c2_hjee {
					font-size: 36rpx;
					font-weight: 600;
					color: #333;
				}
			}
		}
	}
</style>
